package com.java.manage.controller;

import com.java.common.model.Result;
import com.java.manage.model.Color;
import com.java.manage.service.ColorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 车辆颜色
 */
@RestController
@RequestMapping("/color")
public class ColorController {
    @Autowired
    private ColorService colorService;

    @PostMapping("/list")
    public Result list(@RequestBody Color color) {
        return colorService.list(color);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Color color) {
        return colorService.save(color);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Color color) {
        return colorService.modify(color);
    }

    @PostMapping("/remove")
    public Result remove(int[] ids) {
        return colorService.remove(ids);
    }

    /**
     * 查询类型
     * @return
     */
    @PostMapping("/colorList")
    public Result colorList() {
        return colorService.colorList();
    }
}
